import EventEmitter from "../../utils/event-emitter"
export default  (editor:any) => {
    const events = new EventEmitter();

    editor.on=(event:string,callback:any)=>{
      return  events.addListener(event, (val) => {
            callback?.(val)
      });
    }
      
    editor.emit=(event:string,value:any)=>{
       return  events.emit(event, value);
    }

    return editor
  }